/*
//   Copyright 2008 Dear Soft(http://dear-soft.com)
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
 */

package com.dear.soft.components.demo;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;

import com.dear.soft.components.util.DialogUtil;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setTitle("jInlay Components Demo");
		frame.setSize(new Dimension(300, 400));
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

		frame.setLayout(new FormLayout("2dlu,100dlu:grow,2dlu",
				"2dlu,200dlu:grow,2dlu"));
		JTabbedPane tabs = new JTabbedPane();
		addTabs(tabs, new Properties(), new Path());
		frame.add(tabs, new CellConstraints().xy(2, 2, "f,f"));
		DialogUtil.centerWindowInScreen(frame);
		frame.setVisible(true);
	}

	private static void addTabs(JTabbedPane tabs, DemoPanel... panels) {
		for (DemoPanel panel : panels) {
			tabs.addTab(panel.getLabel(), panel.getGui());
		}
	}

}
